<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title><?= $this->iff($args[0], $args[0] . '－') . $this->settings['webName'] ?></title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="/js/layui/css/layui.css"  media="all">
        <link rel="stylesheet" href="/js/layui/css/login.css"  media="all">
        <style>
            body {
                background: url("/images/bg2.jpg");
                background-size: cover;
            }
            .btn-delete {
                color:#CCCCCC;
            }
            .layui-form-mid {
                padding-bottom: 0px !important;
                color:#00ffff !important;
            }
        </style>
    </head>

    <body class="layui-layout-body">
        <header>
            <div class="layui-col-xs6 layui-col-md12" style="height:45px;background: rgba(255,255,255,.02);width: 100%;line-height: 45px;color: #fff;">
                <div class="grid-demo grid-demo-bg2">
                    <div style="margin-left:10px;float: left;position: absolute;"> 
                        <a style="color:#fff;" href="/"><i class="layui-icon"></i> 首页</a>
                    </div>
                    <div style="border-bottom: 1px solid #ccc;margin: auto;text-align: center;">会员注册</div>
                </div>
          </div>
        </header>
        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2><img src="/static/images/logo/logo_zc.png" style="width:80%;height: 80%"></h2>
            </div>
            <form class="layui-form" action="">
                <input type="hidden" name="parentId" value="<?php echo empty($_GET['uid'])? intval($_GET['uid']):0;?>">
                <input type="hidden" name="lid" value="<?php echo empty($_GET['lid'])? intval($_GET['lid']):0;?>">
                <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                        <input id='username' type="tel" name="username" placeholder="请填写登录账号" lay-verify="required" autocomplete="off" class="layui-input">
                        <div class="layui-form-mid layui-word-aux">*账户名由6-15个字符组成</div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                        <input id="password" name="password" lay-verify="pass" placeholder="请输入密码" autocomplete="off" class="layui-input" type="password">
                        <div class="layui-form-mid layui-word-aux">*6-20位密码</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-repass"></label>
                        <input name="comfirm_password" lay-verify="comfirm_pass" placeholder="请确认密码" autocomplete="off" class="layui-input" type="password">
                        <div class="layui-form-mid layui-word-aux">*请再次输入密码以确保输入无误</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-nickname"></label>
                        <input type="text" name="realname" placeholder="请输入真实姓名" lay-verify="realname" autocomplete="off" class="layui-input">
                        <div class="layui-form-mid layui-word-aux">*用于提款银行账户名称</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-cellphone" for="LAY-user-login-cellphone"></label>
                        <input id="m_mobile" type="text" name="mobile" placeholder="请输入手机号码" lay-verify="required|phone" autocomplete="off" class="layui-input">
                        <div class="layui-form-mid layui-word-aux">＊真实手机号码，否则无法修改资料</div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-row">
                          <div class="layui-col-xs7">
                            <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
                            <input name="vcode" id="LAY-user-login-vercode" lay-verify="required|verify" placeholder="图形验证码" class="layui-input" type="text">
                          </div>
                          <div class="layui-col-xs5">
                            <div style="margin-left: 10px;">
                                <img width="178" height="64" alt="验证码" align="absmiddle" src="/user/vcode/<?=$this->time?>" title="看不清楚，点我换图" onclick="this.src='/user/vcode/'+(new Date()).getTime()" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode"/>
                            </div>
                          </div>
                        </div>
                      </div>
                    <div class="layui-form-item">
                        <button style="background: #999900" class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="demo1">注 册</button>
                        <a style="margin-top:5px;" href="/user/login" class="layadmin-user-jump-change layadmin-link">用已有帐号登入</a>
                    </div>
                </div>
            </form>
        </div>

        <script src="/js/layui/layui.js" charset="utf-8"></script>
        <script src="/js/jquery.js" charset="utf-8"></script>
        <script>
            var flag = 0;
            layui.use(['form'], function () {
                var form = layui.form;
                //自定义验证规则
                form.verify({
                    username: function (value) {
                        if (value.length < 6) {
                            return '用户名至少得6个字符';
                        }
                    },
                    pass: [/(.+){6,12}$/, '密码必须6到12位'],
                    comfirm_pass: function (value) {
                        if (!new RegExp($("#password").val()).test(value)) {
                            return "两次输入密码不一致，请重新输入！";
                        }
                    },
                    realname: function (value) {
                        if (value.length < 2) {
                            return '真实姓名至少得2个字符';
                        }
                    },
                    verify: function (value) {
                        if (value.length <= 0) {
                            return '请输入验证码';
                        }
                    },
                });
                //监听提交
                    form.on('submit(demo1)', function (data) {
                    var index = layer.load(1, {
                        shade: [0.5,'#ccc'] //0.1透明度的白色背景
                    });
                    $.post('/user/registered', $('form').serialize(), function (res) {
                        $('#LAY-user-get-vercode').attr('src', '/user/vcode/?time=' + Math.random());
                        layer.close(index);
                        if (res.status == 1) {
                            layer.msg('注册成功，正在跳转...', {
                                icon: 1,
                                time: 2000 //2秒关闭（如果不配置，默认是3秒）
                            }, function () {
                                window.location.href = '/user/login';
                            });
                        } else {
                            layer.msg(res.msg);
                            return;
                        }
                    }, 'json');
                    return false;
                });
            });
        </script>
        <div style="display: none;"><script src="https://s19.cnzz.com/z_stat.php?id=1274861283&web_id=1274861283" language="JavaScript"></script></div>
         <script>
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?2ce9b0cf91cc16447bcb3f7d3d4ea4d6";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
        </script>
    </body>
    
</html>
